package architect;

import java.util.function.Function;

/**
 * @title: JavaFunction
 * @description:
 * @author: guanxin
 * @date: 2019-11-08 23:01
 * @since: Jdk8
 */

public class JavaFunction {

    public static void main(String[] args) {
        System.out.println(test1.apply(100));
        System.out.println(test1.compose(test2).apply(100));
        System.out.println(test1.andThen(test2).apply(100));
    }

    private static Function<Integer, Integer> test1 = i -> i * 2;

    private static Function<Integer, Integer> test2 = i -> i + 100;
}
